home *** CD-ROM | disk | FTP | other *** search
/ This Disc Bytes! / Power Computing - The Disc 2 - This Disc Bytes.ISO / mac / CodeWarrior 7 Lite for 68K / MacOS Support / Headers / Universal Headers / CMICCProfile.h < prev    next >
Text File  |  1995-07-06  |  24KB  |  765 lines

  1. /*
  2.      File:        CMICCProfile.h
  3.  
  4.      Contains:    Definitions for ColorSync 2.0 profile
  5.  
  6.      Version:    Technology:    ColorSync 2.0
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __CMICCPROFILE__
  21. #define __CMICCPROFILE__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32.  
  33. #if PRAGMA_ALIGN_SUPPORTED
  34. #pragma options align=mac68k
  35. #endif
  36.  
  37. #if PRAGMA_IMPORT_SUPPORTED
  38. #pragma import on
  39. #endif
  40.  
  41.  
  42. enum {
  43.     cmCS2ProfileVersion            = 0x02000000
  44. };
  45.  
  46. /* Current Major version number */
  47. enum {
  48.     cmCurrentProfileMajorVersion = 0x02000000
  49. };
  50.  
  51. /* magic cookie number for anonymous file ID */
  52. enum {
  53.     cmMagicNumber                = 'acsp'
  54. };
  55.  
  56. /* ColorSync profile version 1.0 */
  57. enum {
  58.     cmCS1ProfileVersion            = 0x00000100
  59. };
  60.  
  61. /************************************************************************/
  62. /*************** ColorSync 2.0 profile specification ********************/
  63. /************************************************************************/
  64. /* profile flags element values */
  65. enum {
  66.     cmEmbeddedProfile            = 0,                            /* 0 is not embedded profile, 1 is embedded profile */
  67.     cmEmbeddedUse                = 1                                /* 0 is to use anywhere, 1 is to use as embedded profile only */
  68. };
  69.  
  70. /* data type element values */
  71. enum {
  72.     cmAsciiData                    = 0,
  73.     cmBinaryData                = 1
  74. };
  75.  
  76. /* rendering intent element values  */
  77. enum {
  78.     cmPerceptual                = 0,                            /* Photographic images */
  79.     cmRelativeColorimetric        = 1,                            /* Logo Colors */
  80.     cmSaturation                = 2,                            /* Business graphics */
  81.     cmAbsoluteColorimetric        = 3                                /* Logo Colors */
  82. };
  83.  
  84. /* speed and quality flag options */
  85. enum {
  86.     cmNormalMode                = 0,                            /* it uses the least significent two bits in the high word of flag */
  87.     cmDraftMode                    = 1,                            /* it should be evaulated like this: right shift 16 bits first, mask off the */
  88.     cmBestMode                    = 2                                /* high 14 bits, and then compare with the enum to determine the option value */
  89. };
  90.  
  91. /* device/media attributes element values  */
  92. enum {
  93.     cmReflective                = 0,                            /* 0 is reflective media, 1 is transparency media */
  94.     cmGlossy                    = 1                                /* 0 is glossy, 1 is matte */
  95. };
  96.  
  97. /* screen encodings  */
  98. enum {
  99.     cmPrtrDefaultScreens        = 0,                            /* Use printer default screens.  0 is false, 1 is ture */
  100.     cmLinesPer                    = 1                                /* 0 is LinesPerCm, 1 is LinesPerInch */
  101. };
  102.  
  103. /* 2.0 tag type information */
  104. enum {
  105.     cmNumHeaderElements            = 10
  106. };
  107.  
  108. /* public tags */
  109. enum {
  110.     cmAToB0Tag                    = 'A2B0',
  111.     cmAToB1Tag                    = 'A2B1',
  112.     cmAToB2Tag                    = 'A2B2',
  113.     cmBlueColorantTag            = 'bXYZ',
  114.     cmBlueTRCTag                = 'bTRC',
  115.     cmBToA0Tag                    = 'B2A0',
  116.     cmBToA1Tag                    = 'B2A1',
  117.     cmBToA2Tag                    = 'B2A2',
  118.     cmCalibrationDateTimeTag    = 'calt',
  119.     cmCharTargetTag                = 'targ',
  120.     cmCopyrightTag                = 'cprt',
  121.     cmDeviceMfgDescTag            = 'dmnd',
  122.     cmDeviceModelDescTag        = 'dmdd',
  123.     cmGamutTag                    = 'gamt',
  124.     cmGrayTRCTag                = 'kTRC',
  125.     cmGreenColorantTag            = 'gXYZ',
  126.     cmGreenTRCTag                = 'gTRC',
  127.     cmLuminanceTag                = 'lumi',
  128.     cmMeasurementTag            = 'meas',
  129.     cmMediaBlackPointTag        = 'bkpt',
  130.     cmMediaWhitePointTag        = 'wtpt',
  131.     cmNamedColorTag                = 'ncol',
  132.     cmPreview0Tag                = 'pre0',
  133.     cmPreview1Tag                = 'pre1',
  134.     cmPreview2Tag                = 'pre2',
  135.     cmProfileDescriptionTag        = 'desc',
  136.     cmProfileSequenceDescTag    = 'pseq',
  137.     cmPS2CRD0Tag                = 'psd0',
  138.     cmPS2CRD1Tag                = 'psd1',
  139.     cmPS2CRD2Tag                = 'psd2',
  140.     cmPS2CRD3Tag                = 'psd3',
  141.     cmPS2CSATag                    = 'ps2s',
  142.     cmPS2RenderingIntentTag        = 'ps2i',
  143.     cmRedColorantTag            = 'rXYZ',
  144.     cmRedTRCTag                    = 'rTRC',
  145.     cmScreeningDescTag            = 'scrd',
  146.     cmScreeningTag                = 'scrn',
  147.     cmTechnologyTag                = 'tech',
  148.     cmUcrBgTag                    = 'bfd ',
  149.     cmViewingConditionsDescTag    = 'vued',
  150.     cmViewingConditionsTag        = 'view'
  151. };
  152.  
  153. /* custom tags */
  154. enum {
  155.     cmPS2CRDVMSizeTag            = 'psvm'
  156. };
  157.  
  158. /* technology tag descriptions */
  159. enum {
  160.     cmTechnologyFilmScanner        = 'fscn',
  161.     cmTechnologyReflectiveScanner = 'rscn',
  162.     cmTechnologyInkJetPrinter    = 'ijet',
  163.     cmTechnologyThermalWaxPrinter = 'twax',
  164.     cmTechnologyElectrophotographicPrinter = 'epho',
  165.     cmTechnologyElectrostaticPrinter = 'esta',
  166.     cmTechnologyDyeSublimationPrinter = 'dsub',
  167.     cmTechnologyPhotographicPaperPrinter = 'rpho',
  168.     cmTechnologyFilmWriter        = 'fprn',
  169.     cmTechnologyVideoMonitor    = 'vidm',
  170.     cmTechnologyVideoCamera        = 'vidc',
  171.     cmTechnologyProjectionTelevision = 'pjtv',
  172.     cmTechnologyCRTDisplay        = 'CRT ',
  173.     cmTechnologyPMDisplay        = 'PMD ',
  174.     cmTechnologyAMDisplay        = 'AMD ',
  175.     cmTechnologyPhotoCD            = 'KPCD',
  176.     cmTechnologyPhotoImageSetter = 'imgs',
  177.     cmTechnologyGravure            = 'grav',
  178.     cmTechnologyOffsetLithography = 'offs',
  179.     cmTechnologySilkscreen        = 'silk',
  180.     cmTechnologyFlexography        = 'flex'
  181. };
  182.  
  183. /* type signatures */
  184. enum {
  185.     cmSigCurveType                = 'curv',
  186.     cmSigDataType                = 'data',
  187.     cmSigDateTimeType            = 'dtim',
  188.     cmSigLut16Type                = 'mft2',
  189.     cmSigLut8Type                = 'mft1',
  190.     cmSigMeasurementType        = 'meas',
  191.     cmSigNamedColorType            = 'ncol',
  192.     cmSigProfileDescriptionType    = 'desc',
  193.     cmSigScreeningType            = 'scrn',
  194.     cmSigS15Fixed16Type            = 'sf32',
  195.     cmSigSignatureType            = 'sig ',
  196.     cmSigTextType                = 'text',
  197.     cmSigU16Fixed16Type            = 'uf32',
  198.     cmSigU1Fixed15Type            = 'uf16',
  199.     cmSigUInt32Type                = 'ui32',
  200.     cmSigUInt64Type                = 'ui64',
  201.     cmSigUInt8Type                = 'ui08',
  202.     cmSigViewingConditionsType    = 'view',
  203.     cmSigXYZType                = 'XYZ '
  204. };
  205.  
  206. /* Measurement type encodings */
  207. /* Measurement Flare */
  208. enum {
  209.     cmFlare0                    = 0x00000000,
  210.     cmFlare100                    = 0x00000001
  211. };
  212.  
  213. /* Measurement Geometry    */
  214. enum {
  215.     cmGeometryUnknown            = 0x00000000,
  216.     cmGeometry045or450            = 0x00000001,
  217.     cmGeometry0dord0            = 0x00000002
  218. };
  219.  
  220. /* Standard Observer    */
  221. enum {
  222.     cmStdobsUnknown                = 0x00000000,
  223.     cmStdobs1931TwoDegrees        = 0x00000001,
  224.     cmStdobs1964TenDegrees        = 0x00000002
  225. };
  226.  
  227. /* Standard Illuminant */
  228. enum {
  229.     cmIlluminantUnknown            = 0x00000000,
  230.     cmIlluminantD50                = 0x00000001,
  231.     cmIlluminantD65                = 0x00000002,
  232.     cmIlluminantD93                = 0x00000003,
  233.     cmIlluminantF2                = 0x00000004,
  234.     cmIlluminantD55                = 0x00000005,
  235.     cmIlluminantA                = 0x00000006,
  236.     cmIlluminantEquiPower        = 0x00000007,
  237.     cmIlluminantF8                = 0x00000008
  238. };
  239.  
  240. /* Spot Function Value */
  241. enum {
  242.     cmSpotFunctionUnknown        = 0,
  243.     cmSpotFunctionDefault        = 1,
  244.     cmSpotFunctionRound            = 2,
  245.     cmSpotFunctionDiamond        = 3,
  246.     cmSpotFunctionEllipse        = 4,
  247.     cmSpotFunctionLine            = 5,
  248.     cmSpotFunctionSquare        = 6,
  249.     cmSpotFunctionCross            = 7
  250. };
  251.  
  252. /* Color Space Signatures */
  253. enum {
  254.     cmXYZData                    = 'XYZ ',
  255.     cmLabData                    = 'Lab ',
  256.     cmLuvData                    = 'Luv ',
  257.     cmYxyData                    = 'Yxy ',
  258.     cmRGBData                    = 'RGB ',
  259.     cmGrayData                    = 'GRAY',
  260.     cmHSVData                    = 'HSV ',
  261.     cmHLSData                    = 'HLS ',
  262.     cmCMYKData                    = 'CMYK',
  263.     cmCMYData                    = 'CMY ',
  264.     cmMCH5Data                    = 'MCH5',
  265.     cmMCH6Data                    = 'MCH6',
  266.     cmMCH7Data                    = 'MCH7',
  267.     cmMCH8Data                    = 'MCH8'
  268. };
  269.  
  270. /* profileClass enumerations */
  271. enum {
  272.     cmInputClass                = 'scnr',
  273.     cmDisplayClass                = 'mntr',
  274.     cmOutputClass                = 'prtr',
  275.     cmLinkClass                    = 'link',
  276.     cmAbstractClass                = 'abst',
  277.     cmColorSpaceClass            = 'spac'
  278. };
  279.  
  280. /* platform enumerations */
  281. enum {
  282.     cmMacintosh                    = 'APPL',
  283.     cmMicrosoft                    = 'MSFT',
  284.     cmSolaris                    = 'SUNW',
  285.     cmSiliconGraphics            = 'SGI ',
  286.     cmTaligent                    = 'TGNT'
  287. };
  288.  
  289. /* ColorSync 1.0 elements */
  290. enum {
  291.     cmCS1ChromTag                = 'chrm',
  292.     cmCS1TRCTag                    = 'trc ',
  293.     cmCS1NameTag                = 'name',
  294.     cmCS1CustTag                = 'cust'
  295. };
  296.  
  297. /* General element data types */
  298. struct CMDateTime {
  299.     unsigned short                    year;
  300.     unsigned short                    month;
  301.     unsigned short                    dayOfTheMonth;
  302.     unsigned short                    hours;
  303.     unsigned short                    minutes;
  304.     unsigned short                    seconds;
  305. };
  306. typedef struct CMDateTime CMDateTime;
  307.  
  308. struct CMFixedXYZColor {
  309.     Fixed                            X;
  310.     Fixed                            Y;
  311.     Fixed                            Z;
  312. };
  313. typedef struct CMFixedXYZColor CMFixedXYZColor;
  314.  
  315. typedef unsigned short CMXYZComponent;
  316.  
  317. struct CMXYZColor {
  318.     CMXYZComponent                    X;
  319.     CMXYZComponent                    Y;
  320.     CMXYZComponent                    Z;
  321. };
  322. typedef struct CMXYZColor CMXYZColor;
  323.  
  324. struct CM2Header {
  325.     unsigned long                    size;                        /* This is the total size of the Profile */
  326.     OSType                            CMMType;                    /* CMM signature,  Registered with CS2 consortium  */
  327.     unsigned long                    profileVersion;                /* Version of CMProfile format */
  328.     OSType                            profileClass;                /* input, display, output, devicelink, abstract, or color conversion profile type */
  329.     OSType                            dataColorSpace;                /* color space of data */
  330.     OSType                            profileConnectionSpace;        /* profile connection color space */
  331.     CMDateTime                        dateTime;                    /* date and time of profile creation */
  332.     OSType                            CS2profileSignature;        /* 'acsp' constant ColorSync 2.0 file ID */
  333.     OSType                            platform;                    /* primary profile platform, Registered with CS2 consortium */
  334.     unsigned long                    flags;                        /* profile flags */
  335.     OSType                            deviceManufacturer;            /* Registered with CS2 consortium */
  336.     unsigned long                    deviceModel;                /* Registered with CS2 consortium */
  337.     unsigned long                    deviceAttributes[2];        /* Attributes like paper type */
  338.     unsigned long                    renderingIntent;            /* preferred rendering intent of tagged object */
  339.     CMFixedXYZColor                    white;                        /* profile illuminant */
  340.     char                            reserved[48];                /* reserved for future use */
  341. };
  342. typedef struct CM2Header CM2Header;
  343.  
  344. struct CMTagRecord {
  345.     OSType                            tag;                        /* Registered with CS2 consortium */
  346.     unsigned long                    elementOffset;                /* Relative to start of CMProfile */
  347.     unsigned long                    elementSize;
  348. };
  349. typedef struct CMTagRecord CMTagRecord;
  350.  
  351. struct CMTagElemTable {
  352.     unsigned long                    count;
  353.     CMTagRecord                        tagList[1];                    /* Variable size */
  354. };
  355. typedef struct CMTagElemTable CMTagElemTable;
  356.  
  357. /* External 0x02002001 CMProfile */
  358. struct CM2Profile {
  359.     CM2Header                        header;
  360.     CMTagElemTable                    tagTable;
  361.     char                            elemData[1];                /* Tagged element storage. Variable size */
  362. };
  363. typedef struct CM2Profile CM2Profile, **CM2ProfileHandle;
  364.  
  365. /* Tag Type Definitions */
  366. struct CMCurveType {
  367.     OSType                            typeDescriptor;                /* 'curv' */
  368.     unsigned long                    reserved;                    /* fill with 0x00 */
  369.     unsigned long                    countValue;                    /* number of entries in table that follows */
  370.     unsigned short                    data[1];                    /* Tagged element storage. Variable size */
  371. };
  372. typedef struct CMCurveType CMCurveType;
  373.  
  374. struct CMDataType {
  375.     OSType                            typeDescriptor;                /* 'data' */
  376.     unsigned long                    reserved;                    /* fill with 0x00 */
  377.     unsigned long                    dataFlag;                    /* 0 = ASCII, 1 = binary */
  378.     char                            data[1];                    /* Tagged element storage. Variable size */
  379. };
  380. typedef struct CMDataType CMDataType;
  381.  
  382. struct CMDateTimeType {
  383.     OSType                            typeDescriptor;                /* 'dtim' */
  384.     unsigned long                    reserved;
  385.     CMDateTime                        dateTime;
  386. };
  387. typedef struct CMDateTimeType CMDateTimeType;
  388.  
  389. struct CMLut16Type {
  390.     OSType                            typeDescriptor;                /* 'mft2' */
  391.     unsigned long                    reserved;                    /* fill with 0x00 */
  392.     unsigned char                    inputChannels;                /* Number of input channels */
  393.     unsigned char                    outputChannels;                /* Number of output channels */
  394.     unsigned char                    gridPoints;                    /* Number of clutTable grid points */
  395.     unsigned char                    reserved2;                    /* fill with 0x00 */
  396.     Fixed                            matrix[3][3];                /* */
  397.     unsigned short                    inputTableEntries;            /* */
  398.     unsigned short                    outputTableEntries;            /* */
  399.     unsigned short                    inputTable[1];                /* Variable size */
  400.     unsigned short                    CLUT[1];                    /* Variable size */
  401.     unsigned short                    outputTable[1];                /* Variable size */
  402. };
  403. typedef struct CMLut16Type CMLut16Type;
  404.  
  405. struct CMLut8Type {
  406.     OSType                            typeDescriptor;                /* 'mft1' */
  407.     unsigned long                    reserved;                    /* fill with 0x00 */
  408.     unsigned char                    inputChannels;                /* */
  409.     unsigned char                    outputChannels;                /* */
  410.     unsigned char                    gridPoints;                    /* */
  411.     unsigned char                    reserved2;                    /* fill with 0x00 */
  412.     Fixed                            matrix[3][3];                /* */
  413.     unsigned char                    inputTable[256];            /* fixed size of 256 */
  414.     unsigned char                    CLUT[1];                    /* Variable size */
  415.     unsigned char                    outputTable[256];            /* fixed size of 256 */
  416. };
  417. typedef struct CMLut8Type CMLut8Type;
  418.  
  419. struct CMMeasurementType {
  420.     OSType                            typeDescriptor;                /* 'meas' */
  421.     unsigned long                    reserved;                    /* fill with 0x00 */
  422.     unsigned long                    standardObserver;            /* 0 : unknown, 1 : CIE 1931, 2 : CIE 1964 */
  423.     CMFixedXYZColor                    backingXYZ;                    /* absolute XYZ values of backing */
  424.     unsigned long                    geometry;                    /* 0 : unknown, 1 : 0/45 or 45/0, 2 :0/d or d/0 */
  425.     unsigned long                    flare;                        /* 0 : 0%, 1 : 100% flare */
  426.     unsigned long                    illuminant;                    /* standard illuminant */
  427. };
  428. typedef struct CMMeasurementType CMMeasurementType;
  429.  
  430. struct CMNamedColorType {
  431.     OSType                            typeDescriptor;                /* 'ncol' */
  432.     unsigned long                    reserved;                    /* fill with 0x00 */
  433.     unsigned long                    vendorFlag;                    /* */
  434.     unsigned long                    count;                        /* count of named colors in array that follows */
  435.     unsigned char                    prefixName[1];                /* Variable size, max = 32, to access fields after this one, have to count bytes */
  436.     unsigned char                    suffixName[1];                /* Variable size, max = 32 */
  437.     struct {
  438.         unsigned char                    rootName[1];            /* Variable size, max = 32 */
  439.         unsigned char                    colorCoords[1];            /* Variable size  */
  440.     }                                colorName[1];                /* Variable size  */
  441. };
  442. typedef struct CMNamedColorType CMNamedColorType;
  443.  
  444. struct CMTextDescriptionType {
  445.     OSType                            typeDescriptor;                /* 'desc' */
  446.     unsigned long                    reserved;                    /* fill with 0x00 */
  447.     unsigned long                    ASCIICount;                    /* the count of "bytes" */
  448.     unsigned char                    ASCIIName[2];                /* Variable size, to access fields after this one, have to count bytes */
  449.     unsigned long                    UniCodeCode;
  450.     unsigned long                    UniCodeCount;                /* the count of characters, each character has two bytes */
  451.     unsigned char                    UniCodeName[2];                /* Variable size */
  452.     short                            ScriptCodeCode;
  453.     unsigned char                    ScriptCodeCount;            /* the count of "bytes" */
  454.     unsigned char                    ScriptCodeName[2];            /* Variable size */
  455. };
  456. typedef struct CMTextDescriptionType CMTextDescriptionType;
  457.  
  458. struct CMTextType {
  459.     OSType                            typeDescriptor;                /* 'text' */
  460.     unsigned long                    reserved;                    /* fill with 0x00 */
  461.     unsigned char                    text[1];                    /* count of text is obtained from tag size element */
  462. };
  463. typedef struct CMTextType CMTextType;
  464.  
  465. struct CMScreeningType {
  466.     OSType                            typeDescriptor;                /* 'scrn' */
  467.     unsigned long                    reserved;                    /* fill with 0x00 */
  468.     unsigned long                    screeningFlag;                /* bit 0 : use printer default screens, bit 1 : inch/cm */
  469.     unsigned long                    channelCount;
  470.     struct {
  471.         Fixed                            frequency;
  472.         Fixed                            angle;
  473.         unsigned long                    sportFunction;
  474.     }                                channelScreening[1];        /* Variable size */
  475. };
  476. typedef struct CMScreeningType CMScreeningType;
  477.  
  478. struct CMSignatureType {
  479.     OSType                            typeDescriptor;                /* 'sig ' */
  480.     unsigned long                    reserved;                    /* fill with 0x00 */
  481.     OSType                            signature;
  482. };
  483. typedef struct CMSignatureType CMSignatureType;
  484.  
  485. struct CMS15Fixed16ArrayType {
  486.     OSType                            typeDescriptor;                /* 'sf32' */
  487.     unsigned long                    reserved;                    /* fill with 0x00 */
  488.     Fixed                            value[1];                    /* Variable size */
  489. };
  490. typedef struct CMS15Fixed16ArrayType CMS15Fixed16ArrayType;
  491.  
  492. struct CMU16Fixed16ArrayType {
  493.     OSType                            typeDescriptor;                /* 'uf32' */
  494.     unsigned long                    reserved;                    /* fill with 0x00 */
  495.     unsigned long                    value[1];                    /* Variable size */
  496. };
  497. typedef struct CMU16Fixed16ArrayType CMU16Fixed16ArrayType;
  498.  
  499. struct CMUInt16ArrayType {
  500.     OSType                            typeDescriptor;                /* 'ui16' */
  501.     unsigned long                    reserved;                    /* fill with 0x00 */
  502.     unsigned short                    value[1];                    /* Variable size */
  503. };
  504. typedef struct CMUInt16ArrayType CMUInt16ArrayType;
  505.  
  506. struct CMUInt32ArrayType {
  507.     OSType                            typeDescriptor;                /* 'ui32' */
  508.     unsigned long                    reserved;                    /* fill with 0x00 */
  509.     unsigned long                    value[1];                    /* Variable size */
  510. };
  511. typedef struct CMUInt32ArrayType CMUInt32ArrayType;
  512.  
  513. struct CMUInt64ArrayType {
  514.     OSType                            typeDescriptor;                /* 'ui64' */
  515.     unsigned long                    reserved;                    /* fill with 0x00 */
  516.     unsigned long                    value[1];                    /* Variable size (x2) */
  517. };
  518. typedef struct CMUInt64ArrayType CMUInt64ArrayType;
  519.  
  520. struct CMUInt8ArrayType {
  521.     OSType                            typeDescriptor;                /* 'ui08' */
  522.     unsigned long                    reserved;                    /* fill with 0x00 */
  523.     unsigned char                    value[1];                    /* Variable size */
  524. };
  525. typedef struct CMUInt8ArrayType CMUInt8ArrayType;
  526.  
  527. struct CMViewingConditionsType {
  528.     OSType                            typeDescriptor;                /* 'view' */
  529.     unsigned long                    reserved;                    /* fill with 0x00 */
  530.     CMFixedXYZColor                    illuminant;                    /* absolute XYZs of illuminant  in cd/m^2 */
  531.     CMFixedXYZColor                    surround;                    /* absolute XYZs of surround in cd/m^2 */
  532.     unsigned long                    stdIlluminant;                /* see definitions of std illuminants */
  533. };
  534. typedef struct CMViewingConditionsType CMViewingConditionsType;
  535.  
  536. struct CMXYZType {
  537.     OSType                            typeDescriptor;                /* 'XYZ ' */
  538.     unsigned long                    reserved;                    /* fill with 0x00 */
  539.     CMFixedXYZColor                    XYZ[1];                        /* variable size XYZ tristimulus values */
  540. };
  541. typedef struct CMXYZType CMXYZType;
  542.  
  543. /* Profile sequence description type */
  544. struct CMProfileSequenceDescType {
  545.     OSType                            typeDescriptor;                /* 'pseq ' */
  546.     unsigned long                    reserved;                    /* fill with 0x00 */
  547.     unsigned long                    count;                        /* Number of descriptions
  548.                                                          * variable size fields to follow, to access them, must count bytes */
  549.     struct {
  550.         OSType                            deviceMfg;                /* Device Manufacturer */
  551.         OSType                            deviceModel;            /* Decvice Model */
  552.         unsigned long                    attributes[2];            /* Device attributes */
  553.         OSType                            technology;                /* Technology signature */
  554.         unsigned long                    mfgDescASCIICount;        /* the count of "bytes" */
  555.         unsigned char                    mfgDescASCIIName[2];    /* Variable size */
  556.         unsigned long                    mfgDescUniCodeCode;
  557.         unsigned long                    mfgDescUniCodeCount;    /* the count of characters, each character has two bytes */
  558.         unsigned char                    mfgDescUniCodeName[2];    /* Variable size */
  559.         unsigned long                    mfgDescScriptCodeCode;
  560.         unsigned long                    mfgDescScriptCodeCount;    /* the count of "bytes" */
  561.         unsigned char                    mfgDescScriptCodeName[2]; /* Variable size */
  562.         unsigned long                    modelDescASCIICount;    /* the count of "bytes" */
  563.         unsigned char                    modelDescASCIIName[2];    /* Variable size */
  564.         unsigned long                    modelDescUniCodeCode;
  565.         unsigned long                    modelDescUniCodeCount;    /* the count of characters, each character has two bytes */
  566.         unsigned char                    modelDescUniCodeName[2]; /* Variable size */
  567.         short                            modelDescScriptCodeCode;
  568.         unsigned char                    modelDescScriptCodeCount; /* the count of "bytes" */
  569.         unsigned char                    modelDescScriptCodeName[2]; /* Variable size */
  570.     }                                profileDescription[1];
  571. };
  572. typedef struct CMProfileSequenceDescType CMProfileSequenceDescType;
  573.  
  574. /* Under color removal, black generation type */
  575. struct CMUcrBgType {
  576.     OSType                            typeDescriptor;                /* 'bfd  ' */
  577.     unsigned long                    reserved;                    /* fill with 0x00 */
  578.     unsigned long                    ucrCount;                    /* Number of UCR entries */
  579.     unsigned short                    ucrValues[1];                /* variable size */
  580.     unsigned long                    bgCount;                    /* Number of BG entries */
  581.     unsigned short                    bgValues[1];                /* variable size */
  582.     unsigned char                    ucrbgASCII[1];                /* null terminated ASCII string */
  583. };
  584. typedef struct CMUcrBgType CMUcrBgType;
  585.  
  586. struct CMIntentCRDVMSize {
  587.     long                            renderingIntent;            /* rendering intent */
  588.     unsigned long                    VMSize;                        /* VM size taken up by the CRD */
  589. };
  590. typedef struct CMIntentCRDVMSize CMIntentCRDVMSize;
  591.  
  592. struct CMPS2CRDVMSizeType {
  593.     OSType                            typeDescriptor;                /* 'psvm' */
  594.     unsigned long                    reserved;                    /* fill with 0x00 */
  595.     unsigned long                    count;                        /* number of intent entries */
  596.     CMIntentCRDVMSize                intentCRD[1];                /* variable size */
  597. };
  598. typedef struct CMPS2CRDVMSizeType CMPS2CRDVMSizeType;
  599.  
  600. /************************************************************************/
  601. /*************** ColorSync 1.0 profile specification ********************/
  602. /************************************************************************/
  603.  
  604. enum {
  605.     cmGrayResponse                = 0,
  606.     cmRedResponse,
  607.     cmGreenResponse,
  608.     cmBlueResponse,
  609.     cmCyanResponse,
  610.     cmMagentaResponse,
  611.     cmYellowResponse,
  612.     cmUcrResponse,
  613.     cmBgResponse,
  614.     cmOnePlusLastResponse
  615. };
  616.  
  617. /* Device types */
  618. enum {
  619.     cmMonitorDevice                = 'mntr',
  620.     cmScannerDevice                = 'scnr',
  621.     cmPrinterDevice                = 'prtr'
  622. };
  623.  
  624. struct CMIString {
  625.     ScriptCode                        theScript;
  626.     Str63                            theString;
  627. };
  628. typedef struct CMIString CMIString;
  629.  
  630. /* Profile options */
  631.  
  632. enum {
  633.     cmPerceptualMatch            = 0x0000,                        /* Default. For photographic images */
  634.     cmColorimetricMatch            = 0x0001,                        /* Exact matching when possible */
  635.     cmSaturationMatch            = 0x0002                        /* For solid colors */
  636. };
  637.  
  638. /* Profile flags */
  639. enum {
  640.     cmNativeMatchingPreferred    = 0x00000001,                    /* Default to native not preferred */
  641.     cmTurnOffCache                = 0x00000002                    /* Default to turn on CMM cache */
  642. };
  643.  
  644. typedef long CMMatchOption;
  645.  
  646. typedef long CMMatchFlag;
  647.  
  648. struct CMHeader {
  649.     unsigned long                    size;
  650.     OSType                            CMMType;
  651.     unsigned long                    applProfileVersion;
  652.     OSType                            dataType;
  653.     OSType                            deviceType;
  654.     OSType                            deviceManufacturer;
  655.     unsigned long                    deviceModel;
  656.     unsigned long                    deviceAttributes[2];
  657.     unsigned long                    profileNameOffset;
  658.     unsigned long                    customDataOffset;
  659.     CMMatchFlag                        flags;
  660.     CMMatchOption                    options;
  661.     CMXYZColor                        white;
  662.     CMXYZColor                        black;
  663. };
  664. typedef struct CMHeader CMHeader;
  665.  
  666. struct CMProfileChromaticities {
  667.     CMXYZColor                        red;
  668.     CMXYZColor                        green;
  669.     CMXYZColor                        blue;
  670.     CMXYZColor                        cyan;
  671.     CMXYZColor                        magenta;
  672.     CMXYZColor                        yellow;
  673. };
  674. typedef struct CMProfileChromaticities CMProfileChromaticities;
  675.  
  676. struct CMProfileResponse {
  677.     unsigned short                    counts[cmOnePlusLastResponse];
  678.     unsigned short                    data[1];                    /* Variable size */
  679. };
  680. typedef struct CMProfileResponse CMProfileResponse;
  681.  
  682. struct CMProfile {
  683.     CMHeader                        header;
  684.     CMProfileChromaticities            profile;
  685.     CMProfileResponse                response;
  686.     CMIString                        profileName;
  687.     char                            customData[1];                /* Variable size */
  688. };
  689. typedef struct CMProfile CMProfile, **CMProfileHandle;
  690.  
  691. #if OLDROUTINENAMES 
  692.  
  693. enum {
  694.     kCMApplProfileVersion        = cmCS1ProfileVersion
  695. };
  696.  
  697. enum {
  698.     grayResponse                = cmGrayResponse,
  699.     redResponse                    = cmRedResponse,
  700.     greenResponse                = cmGreenResponse,
  701.     blueResponse                = cmBlueResponse,
  702.     cyanResponse                = cmCyanResponse,
  703.     magentaResponse                = cmMagentaResponse,
  704.     yellowResponse                = cmYellowResponse,
  705.     ucrResponse                    = cmUcrResponse,
  706.     bgResponse                    = cmBgResponse,
  707.     onePlusLastResponse            = cmOnePlusLastResponse
  708. };
  709.  
  710. enum {
  711.     rgbData                        = cmRGBData,
  712.     cmykData                    = cmCMYKData,
  713.     grayData                    = cmGrayData,
  714.     xyzData                        = cmXYZData
  715. };
  716.  
  717. enum {
  718.     XYZData                        = cmXYZData
  719. };
  720.  
  721. enum {
  722.     monitorDevice                = cmMonitorDevice,
  723.     scannerDevice                = cmScannerDevice,
  724.     printerDevice                = cmPrinterDevice
  725. };
  726.  
  727. enum {
  728.     CMNativeMatchingPreferred    = cmNativeMatchingPreferred,    /* Default to native not preferred */
  729.     CMTurnOffCache                = cmTurnOffCache                /* Default to turn on CMM cache */
  730. };
  731.  
  732. enum {
  733.     CMPerceptualMatch            = cmPerceptualMatch,            /* Default. For photographic images */
  734.     CMColorimetricMatch            = cmColorimetricMatch,            /* Exact matching when possible */
  735.     CMSaturationMatch            = cmSaturationMatch                /* For solid colors */
  736. };
  737.  
  738. typedef unsigned short XYZComponent;
  739.  
  740. typedef struct CMXYZColor XYZColor;
  741.  
  742. typedef unsigned short CMResponseData;
  743.  
  744. typedef struct CMIString IString;
  745.  
  746. typedef long CMResponseColor;
  747.  
  748. typedef CMResponseColor responseColor;
  749.  
  750. #endif
  751.  
  752. #if PRAGMA_IMPORT_SUPPORTED
  753. #pragma import off
  754. #endif
  755.  
  756. #if PRAGMA_ALIGN_SUPPORTED
  757. #pragma options align=reset
  758. #endif
  759.  
  760. #ifdef __cplusplus
  761. }
  762. #endif
  763.  
  764. #endif /* __CMICCPROFILE__ */
  765.